package com.ruicar.afs.jobadmin.mapper;

import com.ruicar.afs.jobadmin.core.model.AfsJobRegistry;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * The type AfsJobRegistryMapper
 * <p>Description: </p>
 *
 * @author Fzero
 * @version 1.0
 * @date Created on 2020.06.13 14:17:12
 * @since 1.0
 */
@Mapper
public interface AfsJobRegistryMapper {

    /**
     * Find dead list
     *
     * @param timeout timeout
     * @param nowTime now time
     * @return the list
     */
    public List<Integer> findDead(@Param("timeout") int timeout,
                                  @Param("nowTime") Date nowTime);

    /**
     * Remove dead int
     *
     * @param ids ids
     * @return the int
     */
    public int removeDead(@Param("ids") List<Integer> ids);

    /**
     * Find all list
     *
     * @param timeout timeout
     * @param nowTime now time
     * @return the list
     */
    public List<AfsJobRegistry> findAll(@Param("timeout") int timeout,
                                        @Param("nowTime") Date nowTime);

    /**
     * Registry update int
     *
     * @param registryGroup registry group
     * @param registryKey   registry key
     * @param registryValue registry value
     * @param updateTime    update time
     * @return the int
     */
    public int registryUpdate(@Param("registryGroup") String registryGroup,
                              @Param("registryKey") String registryKey,
                              @Param("registryValue") String registryValue,
                              @Param("updateTime") Date updateTime);

    /**
     * Registry save int
     *
     * @param registryGroup registry group
     * @param registryKey   registry key
     * @param registryValue registry value
     * @param updateTime    update time
     * @return the int
     */
    public int registrySave(@Param("registryGroup") String registryGroup,
                            @Param("registryKey") String registryKey,
                            @Param("registryValue") String registryValue,
                            @Param("updateTime") Date updateTime);

    /**
     * Registry delete int
     *
     * @param registryGroup registry group
     * @param registryKey   registry key
     * @param registryValue registry value
     * @return the int
     */
    public int registryDelete(@Param("registryGroup") String registryGroup,
                              @Param("registryKey") String registryKey,
                              @Param("registryValue") String registryValue);

}
